package com.td.module.member.controller.admin.user;

import com.td.framework.common.pojo.CommonResult;
import com.td.module.member.api.user.dto.MemberUserRespDTO;
import com.td.module.member.convert.user.UserConvert;
import com.td.module.member.dal.dataobject.user.MemberUserDO;
import com.td.module.member.service.user.MemberUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static com.td.framework.common.pojo.CommonResult.success;


@Api(tags = "用户 APP - 用户个人中心")
@RestController
@RequestMapping("/member/user")
@Validated
@Slf4j
public class memberUserController {

    @Resource
    private MemberUserService userService;
    @GetMapping("/list-all-member")
    @ApiOperation("获得所有用户")
    public CommonResult<List<MemberUserRespDTO>> listAllMemberUser() {
        List<MemberUserDO> allMemberUser = userService.getAllMemberUser();
        return success(UserConvert.INSTANCE.convertList2(allMemberUser));
    }

}





